﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Javascript.aspx.cs" Inherits="Javascript" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript">
        function x(n) {
            function y() {
                function inner1() {
                    alert(n);
                }

                function inner2() {
                    n = n + 1;
                }

                return [inner1, inner2];
            }
            return y;
        }

        a = x(3);
        farray = a();
        f1 = farray[0];
        f2 = farray[1];

        f1();
        f2();
        f1();

        farray2 = a();
        g1 = farray2[0];
        g2 = farray2[1];

        g1();
        g2();
        f1();

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
</body>
</html>
